<?php
class PostsController extends AppController {

	var $name = 'Posts';

function index() {
		
		$this->set('index', $this->Post->findAll());
}	
	
	
function add() {	
 if (!empty($this->data)) {
		 if ($this->Post->save($this->data)) {
			 $this->flash('Your post has been saved.','/posts');
		 		}
		 	}
				}
}
?>
